package cn.cycleif.admin.controller;

import cn.cycleif.admin.pojo.dto.AdminReportRejectDTO;
import cn.cycleif.admin.pojo.dto.AdminReportResolveDTO;
import cn.cycleif.admin.service.AdminReportService;
import cn.cycleif.util.R;
import cn.dev33.satoken.annotation.SaCheckRole;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Date: 25/2/12-15:47
 * @Desc:
 */
@RestController
@RequestMapping("/sys/report")
@Tag(name = "举报管理", description = "举报相关接口")
@SaCheckRole("staff")
public class AdminReportController {

  @Autowired
  private AdminReportService adminReportService;

  @GetMapping("/list")
  @Operation(summary = "获取举报列表")
  public R<Object> getList() {
    return adminReportService.getPage();
  }

  @GetMapping("/count")
  @Operation(summary = "获取举报数量")
  public R<Long> getCount() {
    return adminReportService.getCount();
  }

  @PostMapping("/reject")
  @Operation(summary = "驳回举报")
  public R<Object> reject(@RequestBody AdminReportRejectDTO dto) {
    return adminReportService.reject(dto);
  }

  @PostMapping("/resolve")
  @Operation(summary = "处理举报")
  public R<Object> resolve(@RequestBody AdminReportResolveDTO dto) {
    return adminReportService.resolve(dto);
  }
}
